Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

n-cli

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

n-cli

a usefull toolset for node commandline applications

  • 1.2.21
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-81.08%
Maintainers
0
Weekly downloads
 
Created
Source

n-cli NPM version Build Status Dependency Status Coverage Status Donate

a usefull toolset for node commandline applications

Installation

$ npm install --save n-cli

Usage

#!/usr/bin/env node


"use strict";

var Cli = new require("n-cli");
var cli = new Cli({
  silent: false,
  handleUncaughtException : true, // beautifies error output to console
  handledRejectionPromiseError : true, // beautifyies error output to console
  runcom : ".myapprc"
});

cli.on("unicorn", function(){
    this.argv.notNull("rainbow");
    this.log(this);
});

cli.runcom(function(rc){ 
    this.log(rc);
});
$ your-client-app unicorn --rainbow forever;

# yields :
{
  prettyError:
   PrettyError { },
  init:
   { appname: 'node-cli-example-app-1',
     handleUncaughtException: true },
  argv: { _: [ 'unicorn' ], rainbow: 'e', notNull: [Function: bound ] },
  config:
   { settings: {},
     appFolder: 'c:\\git\\n-cli\\examples',
     appPackageFilename: 'c:\\git\\n-cli\\examples\\package.json',
     appPackage: {},
     appName: 'node-cli-example-app-1',
     dataFolder: 'C:\\Users\\User\\AppData\\Roaming\\node-cli-example-app-1',
     filename: 'C:\\Users\\User\\AppData\\Roaming\\node-cli-example-app-1\\config.json' },
  color:
   Chalk { },
  Error: [Function: NodeCliError],
  minimist: [Function]
}
$ your-client-app unicorn --rainbow ;

# yields : missing-parameter-value missing value for parameter rainbow.

Build in functions

ncli adds automatically some methods to your commandline application.

# output your version number
$ your-client-app -v;

Output COMMANDLINE-ARGUMENTS.md in your projects root folder

$ your-client-app help;

Help Demo

API

Demo

https://www.youtube.com/watch?v=m53SlSaP6cs

License

MIT © s-a

Keywords

FAQs

Package last updated on 17 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc